<!--
 * @Author: your name
 * @Date: 2022-04-09 15:23:02
 * @LastEditTime: 2022-04-09 15:38:21
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\geyao\实现一个删除字符串前后空格的方法220409.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //去除前后空格
    String.prototype.deletePlace=function(){
      var str=this
      while(str[0]===" "){
        str.substring(1)
      }
      while(str[str.length-1]===" "){
        str.substring(0,str.length-1)
      }
      return str
    }

    
  </script>
</body>
</html>